<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
        .col{
      background-color: yellow;
    }
    .colm{
      background-color: white;
    }
    input{
      display: block;
    }
  </style>
</head>
<body>
  <div >
      <input type="text" class="col" id="ss" style="background-color: yellow;">
    <input type="text" class="col" >
    <input type="text" class="col">
    <input type="text" class="col">
    <input type="text" >
    <input type="text" >
    <input type="text"id="sw">
    <input type="button" value="按钮">
  </div>
  <script>
     var in1 =document.getElementById("ss")
     var in2 =document.getElementById("sw")
    //  只能获取行内样式
    // style的属性值是所有行内样式组成的对象
    console.log(in1.style.backgroundColor);
    // 修改class
    in2.className = ("col")
    // 增加class
    in2.classList.add("colm")
  </script>
</body>
</html>